var accounts = [

];

function my_set_up() {
	var email = $("#email").val();
	var password = $("#password").val();
	var luotest_response = $('input[name^="luotest_response"]').val();
	if (luotest_response == '') {
		console.log('aaa');
		setTimeout(my_set_up, 1000);
		return;
	}
	var invit = $("#invit").val();
	if (email == "" || email == null) {
		layer.tips("请输入邮箱", '#email', {
			tips: 2
		});
		return;
	}
	if (password == "" || password == null) {
		layer.tips("请输入密码", '#password', {
			tips: 2
		});
		return;
	}
	if (luotest_response == "" || luotest_response == null) {
		layer.tips("请验证", '#verify', {
			tips: 2
		});
		return;
	}
	if (!$("#regweb").is(':checked')) {
		layer.tips("请勾选用户注册协议", '#regweb', {
			tips: 3
		});
		return;
	}
	$.post("/login/upregister.html", {
		email: email,
		password: password,
		invit: invit,
		luotest_response: luotest_response,
		token: ""
	}, function(data) {
		if (data.status == 1) {
			layer.msg(data.info, {
				icon: 1
			});
			localStorage['index'] = parseInt(localStorage['index']) + 1;
			window.location.href = location.href;
		} else {
			layer.msg(data.info, {
				icon: 2
			});
			if (data.url) {
				window.location = data.url;
			}
		}
	}, "json");
}

console.log(parseInt(localStorage['index']))
var account = accounts[parseInt(localStorage['index'])];
$("#email").val(account[0]);
$("#password").val(account[1]);

my_set_up();